package me.principality.ktsql.backend.hbase.index

import org.apache.calcite.DataContext
import org.apache.calcite.linq4j.Enumerable
import org.apache.calcite.rex.RexNode

/**
 * 定义IndexTable，用于HBaseTable和实际表实现的交互接口
 */
interface IndexTable {
    fun scan(root: DataContext): Enumerable<Array<Any>>

    fun scan(root: DataContext, filters: List<RexNode>): Enumerable<Array<Any>>

    fun scan(root: DataContext, filters: List<RexNode>,
             projects: IntArray): Enumerable<Array<Any>>

    fun insert(elements: Any?): Boolean

    fun update(elements: Any?): Boolean

    fun removeAll(elements: Collection<Any?>): Boolean
}